"""
URL configuration for student_management project.

The `urlpatterns` list routes URLs to views. For more information please see:
    https://docs.djangoproject.com/en/4.2/topics/http/urls/
Examples:
Function views
    1. Add an import:  from my_app import views
    2. Add a URL to urlpatterns:  path('', views.home, name='home')
Class-based views
    1. Add an import:  from other_app.views import Home
    2. Add a URL to urlpatterns:  path('', Home.as_view(), name='home')
Including another URLconf
    1. Import the include() function: from django.urls import include, path
    2. Add a URL to urlpatterns:  path('blog/', include('blog.urls'))
"""
from django.contrib import admin
from django.urls import path, include
from django.conf.urls.static import static
from django.conf import settings

urlpatterns = [
    path('admin/', admin.site.urls),

    # CSRF校验
    path('', include('mycsrf.urls')),
    # 用户相关(包含登录注册)
    path('', include('users.urls')),
    # 课程管理
    path('', include('courses.urls')),
    # 老师管理
    path('', include('teachers.urls')),
    # 学员管理
    path('', include('students.urls')),
    # 班级管理
    path('', include('classes.urls')),
    # 班级成员管理
    path('', include('classmembers.urls')),
]

# 对外提供media资源
urlpatterns += static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT)
